package com.le.tester.onjava8.l_2_2_6;

/**
 * createTime：2023/1/7 15:49
 * description：深度的，顺序的clone
 */
public class DepthReading implements Cloneable {

    private double depth;

    public DepthReading(double depth) {
        this.depth = depth;
    }

    @Override
    protected DepthReading clone() {
        try {
            return (DepthReading) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new RuntimeException(e);
        }
    }


    public double getDepth() {
        return depth;
    }

    public void setDepth(double depth) {
        this.depth = depth;
    }


    @Override
    public String toString() {
        return String.valueOf(depth);
    }
}
